package com.ruoyi.web.controller.ERP;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.ERP.CustomerErpDTO;
import com.ruoyi.system.domain.ERP.DeptErpDTO;
import com.ruoyi.system.domain.ERP.UsersErpDTO;
import com.ruoyi.system.service.IBaseBomService;
import com.ruoyi.system.service.IBaseMaterialService;
import com.ruoyi.system.service.IProdPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: TODO
 * @Date: 2024/7/22 10:58
 * @Author: zhangq
 * @Version: 1.0
 */
@Api(tags = "erp同步接口api")
@RestController
@RequestMapping("/erpsync" )
public class ErpSyncController {

    @Resource
    private IBaseMaterialService iBaseMaterialService;
    @Resource
    private IBaseBomService iBaseBomService;
    @Resource
    private IProdPlanService prodPlanService;

    /**
     * 同步人员基础信息
     */
    @PostMapping("/syncUsers")
    @ApiOperation(value = "同步人员基础信息")
    public AjaxResult syncUsers(@RequestBody List<UsersErpDTO> userList) {
        return iBaseBomService.syncUsers(userList);
    }

    @PostMapping("/syncDepts")
    @ApiOperation(value = "同步部门信息")
    public AjaxResult syncDepts(@RequestBody List<DeptErpDTO> deptList) {
        return iBaseBomService.syncDepts(deptList);
    }

    @PostMapping("/syncSupplier")
    @ApiOperation(value = "获取供应商信息")
    public AjaxResult syncSupplier(@RequestBody List<CustomerErpDTO> supplierList) {
        return iBaseBomService.syncSupplier(supplierList);
    }

}
